﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

namespace Nirvana
{
    [AddComponentMenu("Nirvana/UI/Control/Click Sound")]
    public class ClickSound : MonoBehaviour, IPointerClickHandler, IEventSystemHandler
    {
        [Tooltip("The audio asset")]
        [SerializeField]
        private AssetID audioAsset;

        public void OnPointerClick(PointerEventData eventData)
        {
            if (!this.audioAsset.IsEmpty)
            {
                AudioManager.PlayAndForget(this.audioAsset);
            }
        }
    }
}

